#! /bin/bash

count=`ps -aux | grep main:app | ps -aux | grep main:app | grep -v grep  | wc -l`
echo $count
if [ $count -ne 0 ];then
  echo 'started'
  exit 0
else
#    /usr/local/python39/bin/gunicorn -k "uvicorn.workers.UvicornWorker" "main:app" -D
  gunicorn -k "uvicorn.workers.UvicornWorker" "main:app" -D
fi

sleep 2
count=`ps -aux | grep main:app | ps -aux | grep main:app | grep -v grep  | wc -l`
echo "Process Count: $count"


